load("@aspect_rules_lint//format:defs.bzl", "format_multirun", "format_test")

py_binary(
    name = "rules_lint_format_wrapper",
    srcs = ["rules_lint_format_wrapper.py"],
    args = [
        "--prettier",
        "$(location //:prettier)",
        "--rules-lint-format",
        "$(location :rules_lint_format)",
        "--rules-lint-format-check",
        "$(location :rules_lint_format.check)",
    ],
    data = [
        ":rules_lint_format",
        ":rules_lint_format.check",
        "//:prettier",
        "@shfmt",
    ],
    env = {
        "SHFMT_PATH": "$(rootpath @shfmt//:shfmt)",
    },
    main = "rules_lint_format_wrapper.py",
    visibility = ["//visibility:public"],
    deps = [
        "//buildscripts:bazel_custom_formatter",
    ],
)

format_multirun(
    name = "rules_lint_format",
    c = "//:clang_format",
    cc = "//:clang_format",
    css = "//:prettier",
    graphql = "//:prettier",
    html = "//:prettier",
    javascript = "//:prettier",
    markdown = "//:prettier",
    python = "@aspect_rules_lint//format:ruff",
    shell = "@shfmt//:shfmt",
    sql = "//:prettier",
    starlark = "@buildifier_prebuilt//:buildifier",
    visibility = ["//visibility:public"],
)
